package StrategyMode.version2;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by ycq on 2018/10/17.
 */
public class CollectingSilver {


    private static void Form1_Load(){
        ArrayList arrayList=new ArrayList();
        arrayList.add("正常");
        arrayList.add("8折");
        arrayList.add("7折");
        arrayList.add("5折");
        System.out.println(arrayList);
        System.out.println("请输入以上字符");
    }

    public  static  void btnOk_Click(Double total){
        while(true) {
            Double totalPrices = 0d;
            Scanner in = new Scanner(System.in);
            System.out.println("请输入单价");
            String txtPrice = in.next();
            System.out.println("请输入数量");
            String txtNum = in.next();
            Form1_Load();
            switch (in.next()) {
                case "正常":
                    totalPrices = Double.parseDouble(txtPrice) * Double.parseDouble(txtNum);
                    break;
                case "8折":
                    totalPrices = Double.parseDouble(txtPrice) * Double.parseDouble(txtNum) * 0.8;
                    break;
                case "7折":
                    totalPrices = Double.parseDouble(txtPrice) * Double.parseDouble(txtNum) * 0.7;
                    break;
                case "5折":
                    totalPrices = Double.parseDouble(txtPrice) * Double.parseDouble(txtNum) * 0.5;
                    break;
            }
            total = total + totalPrices;
            System.out.println("单价:" + txtPrice + " 数量:" + txtNum + " 合计:" + totalPrices);
            System.out.println("总计：" + total);
        }


    }


}
